package com.ruoyi.index.controller;

import com.ruoyi.index.dto.GoodsCategoryDto;
import com.ruoyi.index.dto.GoodsDto;
import com.ruoyi.index.service.GoodsService;
import com.ruoyi.index.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/index/goods")
public class GoodsController {
    @Autowired
    private GoodsService goodsService;
    @RequestMapping("/selectGoods/{goodsStatus}")
    public Result selectGoods(@PathVariable Integer goodsStatus){
        List<GoodsDto> goodsList = goodsService.selectGoods(goodsStatus);
        return Result.success().put("goodsList",goodsList);
}
}
